package com.matt.domain;
import com.matt.foundation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * *******************************
 * 园区产品预警金额
 * Created by Ron.
 * form com.matt
 * on 2018/12/11
 * *******************************
 */
@Entity
@Table(name = "product_warn")
@Data
@EqualsAndHashCode(callSuper = true)
public class ProductWarn extends Domain {

    @Column(columnDefinition = "varchar(32) COMMENT '产品id'")
    private String productId;

    @Column(columnDefinition = "varchar(255) COMMENT '产品名称'")
    private String productName;

    @Column(columnDefinition = "integer default 1 COMMENT '园区类型id'")
    private String areaTypeId;

    @Column(columnDefinition = "varchar(255) COMMENT '园区类型val'")
    private String areaTypeVal;

    @Column(precision = 12, scale = 2, columnDefinition = "decimal(12, 2) default 0  COMMENT '预警单价金额'")
    private BigDecimal warnUnitPrice=BigDecimal.ZERO;

    public static ProductWarn of(String productId,String areaTypeId,BigDecimal warnUnitPrice){
        ProductWarn vo = new ProductWarn();
        vo.setProductId(productId);
        vo.setAreaTypeId(areaTypeId);
        vo.setWarnUnitPrice(warnUnitPrice);
        return vo;
    }
}
